// pages/cooperation/com/com-primary-info/com-primary-info.js

import { houseInfoBehavior } from "../../../../behaviors/houseInfo"

Component({
  behaviors: [houseInfoBehavior],

  /**
   * 组件的属性列表
   */
  properties: {
    model: {
      type: Object,
      default: {}
    }
  },

  options: {
    styleIsolation: 'apply-shared',
    addGlobalClass: true,
  },

  /**
   * 组件的初始数据
   */
  data: {
    _model: {},
  },

  observers: {
    model(value) {
      if (!value || !value.resblockName) return
      // debugger
      let model = {}
      model.resblockName = value.resblockName
      model.delegationType = value.delegationType
      model.totalPrices = value.delegationType == "SALES" ? value.totalPrices / 10000 : value.totalPrices; 
      model.detail = `${this.getRoomHallToilet(value)} | ${value.buildSize}㎡`
      this.setData({
        _model: model
      })
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {

  }
})
